-module(ap_80211_server_sup).
-behaviour(supervisor).
-export([init/1]).
-export([start_link/0,start_child/1]).
-export([forward/2]).
-define(SERVER,?MODULE).

forward(Pid,Packet_Tuple) ->
	ap_80211_server:handle(Pid,{packet_comming,Packet_Tuple}).

start_link() ->
	supervisor:start_link({local,?SERVER},?MODULE,[]).
	
init([]) ->
	Children = [
		{ap_80211_server,{ap_80211_server,start_link,[]},temporary,brutal_kill,worker,[ap_80211_server]}
		],
	RestartStrategy = {simple_one_for_one,0,1},
	{ok,{RestartStrategy,Children}}.
	
start_child(IP) ->
	supervisor:start_child(?SERVER,[IP]).